/**
 * 2018年12月6日下午1:34:39
 * @author 谢进财
 */
package com.baihang.platform.shiro;

import com.baihang.framework.dao.BaseDao;
import com.baihang.platform.model.UserModel;
import com.baihang.platform.model.dbMap.UserRowMapper;

public class SystemAuthorizingDao extends BaseDao {

	public UserModel getUserModel(String userName, String password) {
		UserRowMapper<UserModel> user = new UserRowMapper<UserModel>();
		UserModel model = (UserModel) super.queryForModel(String.format(
				"select * from system_user where userName='%s' and password='%s' limit 1", userName, password), user);
		if (model != null) {
			return model;
		}
		return null;
	}
	public UserModel getUserModel(String userName) {
		UserRowMapper<UserModel> user = new UserRowMapper<UserModel>();
		UserModel model = (UserModel) super.queryForModel(String.format(
				"select * from system_user where userName='%s'  limit 1", userName), user);
		if (model != null) {
			return model;
		}
		return null;
	}
}
